External Player Control API Docs
Getting Started Grooveshark will listen to the file, shortcutAction.txt assuming that the user has turned on “Enable Global Keyboard Shortcuts” (off by default). Users can turn this functionality on by going to “Desktop Options”. Please note: the following are only available in the desktop version of Grooveshark. {GroovesharkFolder} = GroovesharkDesktop.7F9BF17D6D9CB2159C78A6A6AB076EA0B1E0497C.1 It will be announced when this folder name changes. It should not happen for a few years at least, however. External API File Location for GDesktop: *Windows vista/7: %AppData%\{GroovesharkFolder}\Local Store\ *Windows other: %AppData%\{GroovesharkFolder}\Local Store\ *Linux: ~/.appdata/{GroovesharkFolder}/Local Store/ *Mac: ~/Library/Preferences/{GroovesharkFolder}/Local Store/ 7/14/2010: As we transition toward songTokens, the methods below will start defaulting to songToken. p'laySong will be the ONLY method to default to songID (with the songToken equivalent: playSongEx)' as it was added before the switch. SongTokens are at the end of a song url: http://listen.grooveshark.com/#/s/Formed+a+Band/20rXlh (songToken would be: 20rXlh) Interacting with shortcutAction.txt You are to append to the shortcutAction.txt file and never overwrite the file. The application will clear the file once it has accessed and processed the file. '''On application initialize and on change of the "External Player Control" setting, the file will be purged and no commands will be processed. '''All commands should be followed by a newline (\n). This will allow other commands to follow. Multiple commands are allowed to be in the file at once. Commands Command Details Commands listed in groups are alike commands and inherit the initial command's properties unless stated otherwise. Commands Without Parameters *'pause' **Pauses the current song **Does nothing if no song is playing **''Requires version: v2.0 r20100518.2'' *'play' **Plays the current song **If the current song is paused it resumes the song **If no songs are in the queue, it does nothing **''Requires version: v2.0 r20100518.2'' *'playpause' **Toggles between paused and playing **Scenarios of current song ***Not Playing: Plays the song ***Paused: Resumes playback ***Playing: Pauses song **If no songs are in the queue, it does nothing **''Requires version: v2.0 r20100518.2'' *'next' **Plays the next song in the queue **If no songs are left it does nothing *'previous' **Plays the previous song in the queue **If shuffle is enabled, it will play the last song played. **If no songs are left, it will do nothing. **If the current song has been playing for over 5 seconds, it will restart the song. **''Requires version: v2.0 r20100518.2'' *'previousf' **Behaves like previous except it will ALWAYS play the previous song. **''Requires version: v2.0 r20100518.2'' *'previoussong' **Alias for previousf **''Requires version: v2.0 r20100518.2'' *'stop' **Stops playback **If no songs are in the queue, it does nothing **''Requires version: v2.0 r20100518.2'' *'mute' **Toggles mute playback **If player is muted, it will mute **If player is not muted, it will disable mute **''Requires version: v2.0 r20100518.2'' *'volumeup' **Increases the volume by 20% **If the volume is >100% it will do nothing **If the volume is 0 it will set the volume to 10% **''Requires version: v2.0 r20100518.2'' *'volumedown' **Decreases the volume by 20% **Will continue to go to 0 indefinitely. **''Requires version: v2.0 r20100518.2'' *'shuffle' **Toggles between shuffle on/off **Shuffle is persistent as of v2.0 r20100518.2 and this command will affect global shuffle setting **If nothing is in the queue, this will still affect shuffle **''Requires version: v2.0 r20100518.2'' *'toggleshuffle' **Alias for shuffle **''Requires version: v2.0 r20100518.18'' *'clearqueue' **Clears the queue of all the songs. **This will also reset the repeat mode **If the queue is already cleared, this will do nothing **''Requires version: v2.0 r20100518.2'' *'favorite' **Favorites the current song **This will add it to your library as well **If the song is already favorited, this will do nothing **If no song is playing or selected in the queue, nothing will happen **''Requires version: v2.0 r20100518.2'' *'unfavorite' **If the current song is favorited, it will unfavorite it **If the song is not favorited, this will do nothing **''Requires version: v2.0 r20100518.2'' *'togglefavorite' **Toggles the favorite status of the current song **''Requires version: v2.0 r20100518.2'' *'showsongtoast' **Shows a lightbox-style box with the information of the currently selected song or currently playing song **If no song is playing or selected, this will do nothing. **''Requires version: v2.0 r20100518.2'' *'radio' **Toggles the status of radio **If radio is off, it will be turned on **If radio is on, it will be turned off **If nothing is in the queue, radio will not turn on and a message will be presented saying no songs were found. **''Requires version: v2.0 r20100518.5 *'autoplay''' **Alias for radio **''Requires version: v2.0 r20100518.5 *'radioon''' **If radio is off, it will be turned on **''Requires version: v2.0 r20100518.5 *'radiooff''' **If radio is on, it will be turned off **''Requires version: v2.0 r20100518.5 *'smile''' **If radio is on, then the current song will receive a smile (like) **If no song is selected or playing, this will do nothing **If radio is off, this will do nothing **''Requires version: v2.0 r20100518.5 *'frown''' **If radio is on, then the current song will receive a frown (dislike). **After being frowned, a song will stop playing and the next song will begin playing. **''Requires version: v2.0 r20100518.5 *'togglesmile''' **Toggles the smile status of the current song. **''Requires version: v2.0 r20100518.5 *'togglefrown''' **Toggles the frown status of the current song **''Requires version: v2.0 r20100518.5 *'repeat''' **If there are songs in the queue, it will change the repeat setting of the current queue. **If no queue is present, nothing will happen. **This method will toggle between Repeat All, Repeat One, Repeat None. **'Requires version: v2.0 r20100518.18' *'togglerepeat' **Alias for repeat. **'Requires version: v2.0 r20100518.18' *'addtolibrary' **Adds the currently playing song to the users library **If no song is playing, this will do nothing. **'Requires version: v2.0 r20100518.18' Commands with Parameters *'playplaylist' **Clears the current queue and plays the specified playlistID **playlistID is separated by a space and must be numberic **playlistID is required. **''Requires version: v2.0 r20100518.2'' *'playsong' **Plays the song specified by songID **Stops the currently playing song, if one is playing **Adds the song specified to the queue in the next position **songID is separated by a space and must be numberic **If the song specified already exists in the queue, the song will be selected and played. It will not be added. **songID is required. **If songID is invalid, nothing will happen. **''Requires version: v2.0 r20100518.2'' *'playsongex' '' **Plays the song specified by songToken **Follows the same rules as playsong. **Requires version: v2.0 r20100518.18'' *'addsong' **BE CAREFUL! This takes songToken NOT songID. See below for songID. **Adds the song specified by songToken to the end of the queue **songToken is separated by a space **If the song is already in the queue, it WILL be added again. **If songToken is invalid, nothing will happen. **'Requires version: v2.0 r20100518.18' *'addsongfromid' **Adds the song specified by songID to the end of the queue **Follows the same rules as addsong. **'Requires version: v2.0 r20100518.18' *'addsongnext' **Adds the song specified by songToken right after the playing song (or "next") **Follows the same rules as addsong. **'Requires version: v2.0 r20100518.18' *'addsongnextfromid' **Adds the song specified by songID right after the playing song (or "next") **Follows the same rules as addsongfromid. **'Requires version: v2.0 r20100518.18' *'setrepeat' **Changes the current repeat mode of the queue. **If no queue is present, nothing will happen. **Modes are: all, none, one, 0, 1, 2 ***all: changes repeat mode to Repeat All ***none: changes repeat mode to Repeat None ***one: changes repeat mode to Repeat One ***0: changes repeat mode to Repeat None ***1: changes repeat mode to Repeat One ***2: changes repeat mode to Repeat All **If is none of the modes above, nothing will happen. **'Requires version: v2.0 r20100518.18' Coming Soon! *Nothing right now ;)